<?php 
/**
 * ... ...
 * ... ...
 *
 */ 


JCAT_Package::ImportClass('JCAT_Controller',JCAT::PACKAGE_MVC) ;

/**
 * 控制器类 DBDocument 
 *
 * @access public
 */
class DBDocument 
	extends CoderBase 
{

	/**
	 * 构造函数 
	 * 
	 * @access	public
	 * @param	$aParent	JCAT_IController	父控制器 
	 * @return	void
	 */
	public function DBDocument(JCAT_IController $aParent=null )
	{
		// 调用父类构造函数
		$this->CoderBase(__CLASS__,$aParent) ;
		
		// 初始化文档、视图、子控制器 
		$this->Initialize() ;
	}

	/**
	 * 初始化文档、视图、子控制器 
	 * 
	 * @access	public
	 * @return	void
	 */
	public function Initialize()
	{
		//<<[UnmodifiableBlock.Start]::Message Queue::>>//
		// 消息队列
		$aMessageQueue = new JCAT_MessageQueue() ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'MSGMVC') ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'MSGMVC_OK') ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'MSGMVC_BAD') ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'MSGMVC_DEBUG') ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'') ;
		JCAT_MessageDispatcher::RegisterMessageQueue($aMessageQueue,'') ;
		$this->SetMessageQueue($aMessageQueue) ;
		//<<[UnmodifiableBlock.End]::Message Queue::>>// 
		
		
		$sHere = JCAT_Global::TidyPath( dirname(__FILE__) ) ;
		
		// 文档
		$aDoc = new DBDocumentDoc() ;
		$this->AddDocument($aDoc,'MainDoc') ;
		
		// 创建并加载视图：DBDocumentView
		JCAT_Package::ImportClass('DBDocumentView',$sHere.'class.DBDocumentView.php');
		$aView = new DBDocumentView($this) ;
		$this->AddView($aView) ;

		// 创建并加载子控制器：DocumentBase
		JCAT_Package::ImportClass('DocumentBase',$sHere.'../class.DocumentBase.php');
		$aSubController = new DocumentBase($this,$aDoc) ;
		$this->AddController($aSubController) ;

		//<<[UnmodifiableBlock.Start]::Register Children Global Name::>>//
		// 注册全局对象
		$aView = JCAT_View::GetViewByGlobalName('DBDocumentView') ;
		JCAT_View::RegisterGlobalName($aView,'MainView') ;
		//<<[UnmodifiableBlock.End]::Register Children Global Name::>>// 
		
		//<<[UnmodifiableBlock.Start]::Set Document To View::>>//

		//<<[UnmodifiableBlock.End]::Set Document To View::>>// 
		

		
		// 视图  <-> 文档
		$aView = JCAT_View::GetViewByGlobalName('DBDocumentView') ;
		$aView->SetDocument($aDoc) ;
		
		
		
		
		$aSubDoc = $aDoc->GetObjectChildrenDoc() ;
		JCAT_ASSERT::ASSERT_INSTANCE($aSubDoc,'JCATMVCObjectContainerDoc') ;
		$aSubController = new JCATMVCObjectContainer($this,$aSubDoc) ;
		$this->AddController($aSubController,'MVCContainer') ;
		
		
		parent::Initialize($aDoc) ;
	}

	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	string
	 */
	public function GetDialogTitle()
	{
		return JCAT_Language::Sentence('JCAT 数据库文档') ;
	}


	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	void
	 */
	public function SetPath( $sPath )
	{
		$aView = JCAT_View::GetViewByGlobalName('DocumentInfoView') ;
		JCAT_ASSERT::ASSERT_INSTANCE($aView,'DocumentInfoView') ;
		
		$aView->SetPath( $sPath ) ;
	}
	

	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	void
	 */
	public function GetPath()
	{
		$aDoc = $this->GetDocument('MainDoc') ;
		JCAT_ASSERT::ASSERT_INSTANCE($aDoc) ;
		
		return $aDoc->Get('DocumentPath') ;
	}
	
	/**
	 * 执行入口函数 
	 * 
	 * @access	public
	 * @param	$arrArg=array	array	参数 
	 * @return	void
	 */
	public function MainRun(array $arrArg=array())
	{
		parent::MainRun($arrArg) ;
		
		
		//<<[UnmodifiableBlock.Start]::Main Run::>>//
		// 显示视图 DBDocumentView
		$aView = $this->GetView('DBDocumentView') ;
		JCAT_ASSERT::ASSERT_INSTANCE($aView,'JCAT_IView',JCAT_Language::Sentence('名为 %s 的视图未定义','DBDocumentView')) ;
		$aView->ShowView() ;
		//<<[UnmodifiableBlock.End]::Main Run::>>// 

		// TODO
		// ... ...
		
		// 堵塞
		$this->Waiting() ;
	}

	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @param	$			what's this
	 * @return	void
	 */
	public function ConnectDB()
	{
	}
	
}

?><?
/**
 * [注意!!]
 *	以下内容由 JCAT PHP Toolbox 自动维护，手动更改的内容会被 JCAT PHP Toolbox 抹除，
 *	同时还可能破坏格式，导致 JCAT PHP Toolbox 无法正常读取。
 */
/*<<[UnmodifiableBlock.Start]::Coder Dialog Data::>>&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&//
<<{{DocumentClass:ControllerDoc}}>>
eCVEQSU4RFQlQzFuJURCRiUxMCVCRCUxNyVFOCUzRiVBNCVGQyU4MCU4OCVBNCVDNCVENCVBMSU4MyUwMCUyMiU5N1QlQzRmJTI5JTkzJURDJUE1KyU1RCUwMkolMjYlMjRKJTJCJUQxJTE1ZVglQjQlQTFrTiVCRCVGNCU1QyVGNCUxMCVBMCU0MCU4RjklMTdFJUZCNXUlRTElQ0YlRTglMUIlMkElQjIlRTNDJUUzJTFD
JTE2WiVFRSVDRSVDQyU5QiVGNyVERSVBQzIlREIlQjRvJTJBJUJCY2slMkMlREJmJURBaWYlNUIlRjRtJUUwJUMwLSVENyVEQk0lQTlUJUJFOSVDQiVCNnMlRUQlQjQlQjJfJUVBJUI2JUQ2JTlBJTk3JUFCJUJDJTk1JUE5JTNDbyU5RG0lQ0FFJTNFJUREJUI2JTgyJURDJUNEJUI2JUFEJUIzN2clQTIlMkMlRDUlQTQl
REMlQjUl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